package C.e.io.gaoji;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 缓冲字符流-------最常用的读写字符串的流是一对高级流，并且是字符流
 * 内部维护一个默认8KB(8192)长度的char数组，还是以块读写形式读写字符以提高读写效率BufferedWriter和BufferedReader
 */
public class PWDemo {
    public static void main(String[] args) throws IOException {
      /* PrintWriter pw=new PrintWriter("e.txt");
       pw.println("啊");
        pw.println("对对对");
        System.out.println("写完");
        pw.close();

        /* FileOutputStream fos=new FileOutputStream("e.txt");//文件流（低级流）
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);//转换为流
        BufferedWriter bw=new BufferedWriter(osw);//缓冲字符流

        bw.write("啊");
        bw.write("对对对");
        System.out.println("写完");
        bw.close();*/

        //Pp=nP p.p p.p S p.c
        //Ff=nF Oo=nO Bb=nB b.w b.w S b.c
       PrintWriter pw=new PrintWriter("q.txt");
        pw.println("Gk");
        pw.println("wDnMd");
        System.out.println("完");
        pw.close();
       /* FileOutputStream fos=new FileOutputStream("q.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos,StandardCharsets.UTF_8);
        BufferedWriter bw=new BufferedWriter(osw);
        bw.write("GK");
        bw.write("wDnMd");
        System.out.println("完");
        bw.close();*/


















    }
}
